package builder.meal;

import java.util.ArrayList;
import java.util.List;

import builder.item.Item;

public class Meal {
    private List<Item> items = new ArrayList<Item>();

    public void add(Item item) {
        items.add(item);
    }

    public float getCost() {
        float cost = 0.0f;
        for (Item item : items) {
            cost += item.price();
        }
        return cost;
    }

    public void showItem() {
        for (Item item : items) {
            System.out.println("name: " + item.name() + "\npacking: " + item.packing().packing() + "\nprice: " + item.price()+"\n");
        }
    }

}
